<template>
  <div class="goods_list">
    <div class="goods_item" @click="detail">
      <img src="../../static/imgs/cbd.jpg" alt="" />
      <h1>
        华为 HUAWEI Mate 40 RS 保时捷 5G全网通 支持鸿蒙HarmonyOS 陶瓷黑 8G+256G
      </h1>
      <div class="info">
        <div class="price">
          <span class="now"> ￥998 </span>
          <span class="old"> ￥598 </span>
        </div>
        <div class="sell">
          <span>热卖中</span>
          <span>剩60件</span>
        </div>
      </div>
    </div>
    <div class="goods_item">
      <img src="../../static/imgs/shuijiao.jpg" alt="" />
      <h1>OPPO K10 暗夜黑 8+256GB 天玑 8000-MAX 金刚石VC液冷散热</h1>
      <div class="info">
        <div class="price">
          <span class="now"> ￥998 </span>
          <span class="old"> ￥598 </span>
        </div>
        <div class="sell">
          <span>热卖中</span>
          <span>剩60件</span>
        </div>
      </div>
    </div>
    <div class="goods_item">
      <img src="../../static/imgs/muwu.jpg" alt="" />
      <h1>
        Apple MacBook Air 13.3 八核M1芯片(7核图形处理器) 8G 256G SSD 深空灰
        笔记本电脑 MGN63CH/A
      </h1>
      <div class="info">
        <div class="price">
          <span class="now"> ￥998 </span>
          <span class="old"> ￥598 </span>
        </div>
        <div class="sell">
          <span>热卖中</span>
          <span>剩60件</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "GoodsList",
  data() {
    return {};
  },
  methods: {
    detail() {
      this.$router.push({ name: "goodsdetail" });
    },
  },
};
</script>

<style lang="less" scoped>
.goods_list {
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  .goods_item {
    max-height: 320px;
    width: 49.5%;
    border: 1px solid #ccc;
    margin-bottom: 4px;
    padding: 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    img {
      width: 100%;
    }
    h1 {
      font-size: 14px;
    }
    .info {
      background-color: #ccc;
      color: #666;
      line-height: 30px;
      padding: 0 4px;
      .now {
        font-size: 16px;
        color: red;
      }
      .old {
        margin-left: 10px;
        font-size: 14px;
        text-decoration: line-through;
      }
      .sell {
        font-size: 14px;
        display: flex;
        justify-content: space-between;
      }
    }
  }
}
</style>